import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/c-oj/home/question",
    },
    {
      path: "/c-oj/login",
      name: "Login",
      component: () => import("../views/Login.vue"),
    },
    {
      path: "/c-oj/register",
      name: "Register",
      component: () => import("../views/Register.vue"),
    },
    {
      path: "/c-oj/home",
      name: "home",
      component: () => import("../views/Home.vue"),
      children: [
        {
          path: "question",
          name: "question",
          component: () => import("../views/Question.vue"),

        },
        {
          path: "exam",
          name: "exam",
          component: () => import("../views/Exam.vue"),
          meta: {
            showBanner: false,
          },
        },
        {
          path: "blog",
          name: "blog-home",
          component: () => import("../views/blog/BlogHome.vue"),
          meta: {
            showBanner: false,
          },
        },
        {
          path: "blog/:id",
          name: "blog-detail",
          component: () => import("../views/blog/BlogDetail.vue"),
          meta: {
            showBanner: false,
          },
        },
        {
          path: "blog/editor",
          name: "blog-editor",
          component: () => import("../views/blog/BlogEditor.vue"),
          meta: {
            showBanner: false,
          },
        },
        {
          path: "blog/center",
          name: "blog-center",
          component: () => import("../views/blog/BlogCenter.vue"),
          meta: {
            showBanner: false,
          },
        },
        {
          path: "user/exam",
          name: "userExam",
          component: () => import("../views/UserExam.vue"),
          meta: {
            showBanner: false,
          },
        },
        {
          path: "user/message",
          name: "UserMessage",
          component: () => import("../views/UserMessage.vue"),
          meta: {
            showBanner: false,
          },
        },
        {
          path: "user/detail",
          name: "UserDetail",
          component: () => import("../views/UserDetail.vue"),
          meta: {
            showBanner: false,
          },
        },
      ],
    },
  ],
});

export default router;
